package gold.digger;

/**
 * Created by fanzhenyu02 on 2020/6/27.
 * common problem solver template.
 */
public class LC342 {
    public long startExecuteTime = System.currentTimeMillis();


    class Solution {
        public boolean isPowerOfFour(int n) {
            if (n <= 0) return false;
            if (n == 1) return true;
            if (n % 4 != 0) return false;
            return isPowerOfFour(n / 4);
        }
    }


    public void run() {
        Solution solution = new Solution();
        System.out.println(solution.isPowerOfFour(-2147483648));
    }

    public static void main(String[] args) throws Exception {
        LC342 an = new LC342();
        an.run();

        System.out.println("\ncurrent solution total execute time: " + (System.currentTimeMillis() - an.startExecuteTime) + " ms.");
    }
}
